package com.Maykk.Demo04;

/**
 * @ClassName: Demo01
 * @Description: TODO
 * @Author: MaykkStar@163.com
 */
public class DemoTest {
    public static void main(String[] args) {
        MyRunnable myRun = new MyRunnable();
        // MyThread mt01 = new MyThread("张三");
        // MyThread mt02 = new MyThread("张三");
        // MyThread mt03 = new MyThread("张三");
        Thread mt01 = new Thread(myRun,"张三");
        Thread mt02 = new Thread(myRun,"李四");
        Thread mt03 = new Thread(myRun,"王五");

        // 设置进程为守护进程
        mt01.setDaemon(true);
        mt02.setDaemon(true);
        mt03.setDaemon(true);

        // mt01.setPriority(Thread.MAX_PRIORITY);
        // mt02.setPriority(Thread.MAX_PRIORITY);
        // mt03.setPriority(Thread.MAX_PRIORITY);

        mt01.start();
        mt02.start();
        mt03.start();

        for (int i = 0; i < 3; i++) {
            System.out.println("我也在说话~~");
        }
        System.out.println("上课了，不要说话了！~====================================");
    }
}
